//
//  LocationManager.h
//  PersonalProject
//
//  Created by 卫建 on 15/12/18.
//  Copyright © 2015年 卫建. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>

typedef void(^LocationBlock)(CLLocationCoordinate2D coor);

//定义一个block,声明地理编码的block
typedef void(^GeographyCodingBlock)(CLLocationCoordinate2D coordinate);

//定义一个block,声明逆地理编码
typedef void(^UpGeographyCodingBlock)(NSString *address);

@interface LocationManager : NSObject

+(instancetype)sharedLocationManager;

#pragma mark-------开始定位
-(void)startLocation;
#pragma mark-------停止定位
//-(void)stopLocation;
#pragma mark-------实时更新位置的block回调
@property(nonatomic,copy)LocationBlock updateBlock;

//#pragma mark-------地理编码,根据地址获取经纬度
//-(void)getCoordinateWithAddress:(NSString *)address
//                     withFinish:(GeographyCodingBlock)finishBlock;
//
#pragma mark-------逆地理编码
-(void)getAddressWithCoordinate:(CLLocationCoordinate2D)coordinate
                     withFinish:(UpGeographyCodingBlock)finishBlock;



@property(nonatomic,strong)CLLocationManager *locationManager;

@property(nonatomic,strong)CLGeocoder *geocoder;
@property(nonatomic,strong)CLLocation *location;

@property(nonatomic,strong)CLPlacemark *mark;

@property(nonatomic,strong)NSMutableDictionary *dictionary;

@end
